package com.app.micaihu.view.main.game.presenter

import com.app.base.mvp.BasePresenter
import com.app.http.NetRequestListener
import com.app.http.bean.BaseBean
import com.app.micaihu.bean.game.GameCenterEntity
import com.app.micaihu.utils.ApiServiceUtils.apiService
import com.app.micaihu.utils.ParamsMapUtils
import com.app.micaihu.view.army.contract.ArmyCreateContract
import com.app.micaihu.view.bean.ArmyCreateInfo
import com.app.micaihu.view.main.game.contract.GameContract
import com.app.utils.biz.Biz

/**
 * 游戏 猜你喜欢
 */
open class GamePresenter : BasePresenter<GameContract.View>(), GameContract.Presenter {

    override fun gameLike() {
        val params = ParamsMapUtils.commonParams
        requestNetwork(apiService.gameLike(params), object : NetRequestListener<BaseBean<List<GameCenterEntity>?>?> {
            override fun onSuccess(result: BaseBean<List<GameCenterEntity>?>?) {
                getView()?.hideLoading()
                getView()?.handleGameLike(result)
            }

            override fun onFailed(e: Throwable?) {
                getView()?.hideLoading()
                getView()?.handleGameLike(null)
                getView()?.onError(e)
            }
        })
    }

}